project(ufifo)

ExternalProject_Add(build-${PROJECT_NAME}
    GIT_REPOSITORY "https://github.com/ShenChen1/ufifo.git"
    CONFIGURE_COMMAND true
    BUILD_COMMAND make all CROSS_COMPILE=${CMAKE_CROSS_PREFIX}
    INSTALL_COMMAND true
    BUILD_IN_SOURCE 1)

set(UFIFO_HEADER_DIR "${PROJECT_BINARY_DIR}/build-${PROJECT_NAME}-prefix/src/build-${PROJECT_NAME}/inc"
    CACHE PATH INTERNAL FORCE)
set(UFIFO_LINK_DIR "${PROJECT_BINARY_DIR}/build-${PROJECT_NAME}-prefix/src/build-${PROJECT_NAME}/obj"
    CACHE PATH INTERNAL FORCE)

install(FILES ${UFIFO_LINK_DIR}/libufifo.so DESTINATION ${CMAKE_INSTALL_LIBDIR})